package jy.game.components.battle;


import android.text.TextUtils;

import jy.game.components.role.JyRole;
import jy.game.tools.JyResourceManager;
import wx.xml.simpleframework.xml.Attribute;
import wx.xml.simpleframework.xml.Root;

@Root(name = "role")
public class JyBattleRole {

    @Attribute(name = "key")
    public String predefinedKey;

    @Attribute(name = "team")
    public int     team = 1;
    @Attribute(name = "x")
    public int     x;
    @Attribute(name = "y")
    public int     y;
    @Attribute(name = "face")
    public int     face = 1;
    @Attribute(name = "level")
    public int     level;
    @Attribute(name = "name")
    public String  name;
    @Attribute(name = "animation")
    public String  animation;
    @Attribute(name = "boss")
    public boolean isBoss;

    @Attribute(name = "difficulty")
    public  String  difficulty;
    // [XmlIgnore]
    public  boolean isPlayerPickedRole;
    // [XmlIgnore]
    public int    random_level = -1;
    // [XmlIgnore]
    public String random_name;
    // [XmlIgnore]
    private JyRole  _role;

    // (get) Token: 0x060003A5 RID: 933 RVA: 0x00029CA0 File Offset: 0x00027EA0
    // (set) Token: 0x060003A6 RID: 934 RVA: 0x00004015 File Offset: 0x00002215
    // [XmlIgnore]
    public JyRole role() {
        if (this._role != null) {
            return this._role;
        }
        if (!TextUtils.isEmpty(this.predefinedKey)) {
            this._role = JyResourceManager.get(JyRole.class, this.predefinedKey);
            return this._role;
        }
        return null;
    }

    public void setRole(JyRole value) {
        this._role = value;
    }

    // (get) Token: 0x060003A7 RID: 935 RVA: 0x0000401E File Offset: 0x0000221E
    public boolean faceRight() {
        return this.face == 1;
    }

    // (get) Token: 0x060003A8 RID: 936 RVA: 0x00004029 File Offset: 0x00002229
    public boolean isRandom() {
        return this.random_level != -1;
    }
}
